<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form action="" method="post" name="form">
        <input type="checkbox" name="checked" id="" >同意并接受注册协议<br>
        <button name="push">提交</button>
    </form>
    <script>
        let form = document.forms.form;
        let check = form['checked'];
        let push = form['push'];
        push.onclick=function(){
                if(check.checked!=true){
                alert('不同意协议，我们将无法为您提供服务');
            }else{
                alert('提交成功')
            }
        }
    </script>
</body>

</html>